package com.ruoyi.service.impl;
import com.ruoyi.domain.Person;
import com.ruoyi.mapper.PersonMapper;
import com.ruoyi.service.IPersonService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class PersonServiceImpl implements IPersonService {
    @Autowired
    PersonMapper personMapper;

    @Override
    public List<Person> list() {
        return personMapper.selectList();
    }

    @Override
    public List<Person> listForPage(Person person) {
        return personMapper.selectListForPage(person);
    }

    @Override
    public Person getById(Long id) {
        return personMapper.selectByPrimaryKey(id);
    }

    @Override
    public int save(Person person) {
        return personMapper.insertSelective(person);
    }

    @Override
    public int updateById(Person person) {
        return personMapper.updateByPrimaryKeySelective(person);
    }

    @Override
    public int removeByIds(Long[] ids) {
        return personMapper.deleteByPrimaryKeys(ids);
    }
}
